#include <iostream>
using namespace std;

//https://www.nowcoder.com/practice/fe6c73cb899c4fe1bdd773f8d3b42c3d?tpId=122&tqId=33649&ru=/exam/oj

int gcd(int a, int b)
{
    if (b == 0) return a;
    return gcd(b, a % b);
}

int main()
{
    long long n, x;
    while (cin >> n >> x)
    {
        int b;
        while (n--)
        {
            cin >> b;

            if (x >= b)
                x += b;
            else
                x += gcd(x, b);
        }
        cout << x << endl;
    }
    return 0;
}
